<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>立即执行函数</title>
<body>
    <button onclick="fun()">点我</button>
    
</body>
<script>

    (function fun1(){
        var username = '张三';
       console.log(username);
    })();
    //立即执行函数  "  (function(){})();  "
     (function fun2(){
        var username = '李四'; 
        console.log(username);

     })();
   


</script>
</html>